package com.ruoyi.system.service.impl;

import java.util.List;
import com.ruoyi.common.core.utils.DateUtils;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;
import com.ruoyi.system.mapper.TbRoomReservationMapper;
import com.ruoyi.system.domain.TbRoomReservation;
import com.ruoyi.system.service.ITbRoomReservationService;

/**
 * 预约房源Service业务层处理
 * 
 * @author ruoyi
 * @date 2021-06-21
 */
@Service
public class TbRoomReservationServiceImpl implements ITbRoomReservationService 
{
    @Autowired
    private TbRoomReservationMapper tbRoomReservationMapper;

    /**
     * 查询预约房源
     * 
     * @param id 预约房源ID
     * @return 预约房源
     */
    @Override
    public TbRoomReservation selectTbRoomReservationById(String id)
    {
        return tbRoomReservationMapper.selectTbRoomReservationById(id);
    }

    /**
     * 查询预约房源列表
     * 
     * @param tbRoomReservation 预约房源
     * @return 预约房源
     */
    @Override
    public List<TbRoomReservation> selectTbRoomReservationList(TbRoomReservation tbRoomReservation)
    {
        return tbRoomReservationMapper.selectTbRoomReservationList(tbRoomReservation);
    }

    /**
     * 新增预约房源
     * 
     * @param tbRoomReservation 预约房源
     * @return 结果
     */
    @Override
    public int insertTbRoomReservation(TbRoomReservation tbRoomReservation)
    {
        tbRoomReservation.setCreateTime(DateUtils.getNowDate());
        return tbRoomReservationMapper.insertTbRoomReservation(tbRoomReservation);
    }

    /**
     * 修改预约房源
     * 
     * @param tbRoomReservation 预约房源
     * @return 结果
     */
    @Override
    public int updateTbRoomReservation(TbRoomReservation tbRoomReservation)
    {
        return tbRoomReservationMapper.updateTbRoomReservation(tbRoomReservation);
    }

    /**
     * 批量删除预约房源
     * 
     * @param ids 需要删除的预约房源ID
     * @return 结果
     */
    @Override
    public int deleteTbRoomReservationByIds(String[] ids)
    {
        return tbRoomReservationMapper.deleteTbRoomReservationByIds(ids);
    }

    /**
     * 删除预约房源信息
     * 
     * @param id 预约房源ID
     * @return 结果
     */
    @Override
    public int deleteTbRoomReservationById(String id)
    {
        return tbRoomReservationMapper.deleteTbRoomReservationById(id);
    }

    @Override
    public boolean addyuyue(TbRoomReservation roomReservation) {
        return tbRoomReservationMapper.addyuyue(roomReservation);
    }

//    @Override
//    public List<TbRoomReservation> selyuyue(Integer id) {
//        return tbRoomReservationMapper.selyuyue(id);
//    }
}
